﻿using BaMusaSoft.RPS.ViewModel;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using BaMusaSoft.RPS.DataModel;
using BaMusaSoft.RPS.DataModel.Repositories;
using System.Windows.Input;

namespace ViewModelTest
{
    
    
    /// <summary>
    ///This is a test class for ClaimViewModelTest and is intended
    ///to contain all ClaimViewModelTest Unit Tests
    ///</summary>
    [TestClass()]
    public class ClaimViewModelTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for PrintCommand
        ///</summary>
        [TestMethod()]
        public void PrintCommandTest()
        {
            Claim claim = new Claim();
            claim.Customer = new Customer();
            claim.Customer.Name = "محمد علي عوض اليافعي";
            claim.Outbox = new Outbox();
            claim.Outbox.OutboxNo = "1000/432/ج";
            claim.Outbox.OutboxDate = "1432 / 01 / 01";
            claim.ClaimNo = "2";
            claim.CaptionText1 = "أعوذ بالله من الشيطان الرجيم";
            claim.CaptionText2 = "بسم الله الرحمن الرحيم";
            claim.ClaimDetails = new System.Data.Objects.DataClasses.EntityCollection<ClaimDetail>();
            
            for (int i = 0; i < 6; i++)
            {
                ClaimDetail detail = new ClaimDetail();
                detail.Property = new Property();
                detail.Property.PropertyNo = "212109";
                detail.Property.Description = "شقة 12- عمارة الخاسكية";
                detail.Rent = 37500;
                detail.RentPaid = 12000;
                detail.Maintenance = 1500;
                detail.Deposit = 3000;
                detail.Other = 0;
                detail.RentBalance = 25500;
                detail.ArrearRent = 0;
                detail.ArrearMaintenance = 0;
                detail.Total = 30000;
                claim.ClaimDetails.Add(detail);    
            }
            
            ClaimRepository repository = new ClaimRepository(new SchedulesEntities());
            ClaimViewModel target = new ClaimViewModel(claim, repository); // TODO: Initialize to an appropriate value
            ICommand actual;
            target.PrintCommand.Execute(null);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
    }
}
